<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>

        window.onload=function () {
              var ele=document.getElementsByClassName("c1")[0];
              alert(ele)
        } ;


    </script>

</head>
<body>

<div class="c1">DIV</div>



</body>
</html>